local shishou = fk.CreateSkill {

  name = "joy__shishou",

  tags = { Skill.Compulsory, },

}



shishou:addEffect(fk.CardUseFinished, {
  name = "joy__shishou",
  events = { fk.CardUseFinished, fk.Damaged},
  anim_type = "negative",
  frequency = Skill.Compulsory,
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(shishou.name) and target == player then
      if event == fk.CardUseFinished then
        return player:getMark("@cangchu") > 0 and data.card.name == "analeptic"
      else
        return player:getMark("@cangchu") > 0 and data.damageType == fk.FireDamage
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
      room:removePlayerMark(player, "@cangchu")
      room:broadcastProperty(player, "MaxCards")
  end,
})
shishou:addEffect(fk.Damaged, {
  name = "joy__shishou",
  events = { fk.CardUseFinished, fk.Damaged},
  anim_type = "negative",
  frequency = Skill.Compulsory,
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(shishou.name) and target == player then
      if event == fk.CardUseFinished then
        return player:getMark("@cangchu") > 0 and data.card.name == "analeptic"
      else
        return player:getMark("@cangchu") > 0 and data.damageType == fk.FireDamage
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
      room:removePlayerMark(player, "@cangchu")
      room:broadcastProperty(player, "MaxCards")
  end,
})

return shishou